package com.lsus.golkhadi.client.images;

import java.util.HashMap;
import java.util.Map;
import com.google.gwt.resources.client.ImageResource;
import com.lsus.golkhadi.shared.Card;

public class CardToImageMap {
	
	private static CardToImageMap instance = null;
	private static Map<Card, Invoke> cardToImage = new HashMap<Card, Invoke>();
		
	public static CardToImageMap getInstance(){
		if (instance == null){
			instance = new CardToImageMap();
			loadAllMappings();
		}
		return instance;
	}
	
	public Map<Card, Invoke> getMap(){
		return cardToImage;
	}
	
	private static void loadAllMappings(){
		
		//Clubs
		cardToImage.put(Card.CLUB1, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club1(); }
			});
		cardToImage.put(Card.CLUB2, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club2(); }
			});
		cardToImage.put(Card.CLUB3, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club3(); }
			});
		cardToImage.put(Card.CLUB4, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club4(); }
			});
		cardToImage.put(Card.CLUB5, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club5(); }
			});
		cardToImage.put(Card.CLUB6, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club6(); }
			});
		cardToImage.put(Card.CLUB7, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club7(); }
			});
		cardToImage.put(Card.CLUB8, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club8(); }
			});
		cardToImage.put(Card.CLUB9, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club9(); }
			});
		cardToImage.put(Card.CLUB10, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club10(); }
			});
		cardToImage.put(Card.CLUB11, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club11(); }
			});
		cardToImage.put(Card.CLUB12, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club12(); }
			});
		cardToImage.put(Card.CLUB13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club13(); }
			});
		
		cardToImage.put(Card.CLUB13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club13(); }
			});
		
		cardToImage.put(Card.CLUB13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Club13(); }
			});
		
		//Diamonds
		cardToImage.put(Card.DIAMOND1, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond1(); }
			});
		cardToImage.put(Card.DIAMOND2, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond2(); }
			});
		cardToImage.put(Card.DIAMOND3, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond3(); }
			});
		cardToImage.put(Card.DIAMOND4, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond4(); }
			});
		cardToImage.put(Card.DIAMOND5, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond5(); }
			});
		cardToImage.put(Card.DIAMOND6, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond6(); }
			});
		cardToImage.put(Card.DIAMOND7, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond7(); }
			});
		cardToImage.put(Card.DIAMOND8, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond8(); }
			});
		cardToImage.put(Card.DIAMOND9, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond9(); }
			});
		cardToImage.put(Card.DIAMOND10, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond10(); }
			});
		cardToImage.put(Card.DIAMOND11, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond11(); }
			});
		cardToImage.put(Card.DIAMOND12, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond12(); }
			});
		cardToImage.put(Card.DIAMOND13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Diamond13(); }
			});
		
		//Spades
		cardToImage.put(Card.SPADE1, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade1(); }
			});
		cardToImage.put(Card.SPADE2, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade2(); }
			});
		cardToImage.put(Card.SPADE3, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade3(); }
			});
		cardToImage.put(Card.SPADE4, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade4(); }
			});
		cardToImage.put(Card.SPADE5, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade5(); }
			});
		cardToImage.put(Card.SPADE6, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade6(); }
			});
		cardToImage.put(Card.SPADE7, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade7(); }
			});
		cardToImage.put(Card.SPADE8, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade8(); }
			});
		cardToImage.put(Card.SPADE9, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade9(); }
			});
		cardToImage.put(Card.SPADE10, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade10(); }
			});
		cardToImage.put(Card.SPADE11, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade11(); }
			});
		cardToImage.put(Card.SPADE12, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade12(); }
			});
		cardToImage.put(Card.SPADE13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Spade13(); }
			});
		
		//Heart
		cardToImage.put(Card.HEART1, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart1(); }
			});
		cardToImage.put(Card.HEART2, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart2(); }
			});
		cardToImage.put(Card.HEART3, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart3(); }
			});
		cardToImage.put(Card.HEART4, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart4(); }
			});
		cardToImage.put(Card.HEART5, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart5(); }
			});
		cardToImage.put(Card.HEART6, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart6(); }
			});
		cardToImage.put(Card.HEART7, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart7(); }
			});
		cardToImage.put(Card.HEART8, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart8(); }
			});
		cardToImage.put(Card.HEART9, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart9(); }
			});
		cardToImage.put(Card.HEART10, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart10(); }
			});
		cardToImage.put(Card.HEART11, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart11(); }
			});
		cardToImage.put(Card.HEART12, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart12(); }
			});
		cardToImage.put(Card.HEART13, new Invoke() {
			   public ImageResource imageGetter() { return GolkhadiImageBundle.INSTANCE.Heart13(); }
			});
	}

}
